package com.asiainfo.iov.application;

import android.app.Application;

import com.framework.application.FrameApplication;

public class ShareApplication extends Application {

    // //////////////////
    public static ShareApplication application;

    /**
     * 获取ShareApplication的单例
     *
     * @return ApplicationController singleton instance
     */
    public static synchronized ShareApplication getInstance() {
        return application;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        FrameApplication.onCreate(this);
        application = this;
//        initDefaultUncaughtExceptionHandler();
    }

    /**
     * 初始化全局未被捕获的异常
     */
    private void initDefaultUncaughtExceptionHandler() {
        // 设置该MyUncaughtExceptionHandler为程序的默认处理器
        MyUncaughtExceptionHandler myUncaughtExceptionHandler = new MyUncaughtExceptionHandler(
                this);
        Thread.setDefaultUncaughtExceptionHandler(myUncaughtExceptionHandler);
    }
}
